home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / jazlib.arc / SCREEN.DMO < prev    next >
Text File  |  1988-12-18  |  2KB  |  84 lines

  1. /*
  2. ┌────────────────────────────────────────────────────────────────────────────┐
  3. │screen.dmo                                     │
  4. │Demo of some of the windowing routines in the system.                 │
  5. │                                         │
  6. │ (C) JazSoft Software by Jack A. Zucker (301) 794-5950              │
  7. └────────────────────────────────────────────────────────────────────────────┘
  8. */
  9.  
  10. #include "jaz.h"
  11. #include "dos.h"
  12. #include "stdio.h"
  13. #include "jzscreen.h"
  14. #include "gscreen.h"
  15. #include "conio.h"
  16.  
  17. #define cmsg "This is a test of the emergency broadcast system"
  18.  
  19. main()
  20. {
  21.   register w;
  22.   int count=0;
  23.   int wrow,wcol,wstart,wend;
  24.   THEADER *jzcreate(),*pheader;
  25.   TWINDOW *pwindow,*jzappend(),*ptr;
  26.  
  27.   jzgetcur(&wrow,&wcol,&wstart,&wend);    /* get cursor position and size */
  28.   wrow -= 2;                /* position back to original place */
  29.  
  30.   jzsetcur(0x20,0x20);            /* turn of cursor */
  31.  
  32.   pheader = jzcreate();     /* get header node of list */
  33.  
  34.   ptr = jzappend(pheader,31,0,0,15,39); /* save original window contents */
  35.  
  36.   jzdrwbox(0,0,40,16,11);        /* draw window box */
  37.  
  38.   window(1,1,14,38,7);            /* set window dim and color */
  39.  
  40.   for ( w = 0 ; w < 127 ; w ++ )    /* scroll rainbow of colors */
  41.     jzwndwrt(cmsg,g_row,g_col,w);
  42.  
  43.   pwindow = jzappend(pheader,31,0,0,15,39); /* save rainbow of colors */
  44.  
  45.   for (w = 0 ; w < 40 ; w ++) {
  46.     jzrstwnd(ptr);        /* restore what's under the window */
  47.     ptr->col1++;        /* increment column position */
  48.     ptr->col2++;
  49.     jzsavwnd(ptr);        /* save the next position */
  50.     jzmovwnd(pwindow,0,w+1);    /* move window to nex pos */
  51.   }
  52.  
  53.   for ( w = 0 ; w < 9 ; w ++) {
  54.     jzrstwnd(ptr);
  55.     ptr->row1++;
  56.     ptr->row2++;
  57.     jzsavwnd(ptr);
  58.     jzmovwnd(pwindow,w+1,40);
  59.   }
  60.  
  61.   for ( w = 40 ; w > 0 ; w --) {
  62.     jzrstwnd(ptr);
  63.     ptr->col1--;
  64.     ptr->col2--;
  65.     jzsavwnd(ptr);
  66.     jzmovwnd(pwindow,9,w-1);
  67.   }
  68.  
  69.   for ( w = 9 ; w > 0 ; w --) {
  70.     jzrstwnd(ptr);
  71.     ptr->row1--;
  72.     ptr->row2--;
  73.     jzsavwnd(ptr);
  74.     jzmovwnd(pwindow,w-1,0);
  75.   }
  76.  
  77.   jzsetcur(wstart,wend);        /* restore cursor size */
  78.   jzwrtstr("Hit <ENTER> to continue...",14,1,0x87); /* print blinking */
  79.   getchar();
  80.   jzrstwnd(ptr);
  81.   jzloccur(wrow,wcol);
  82. }
  83.  
  84.